package com.demo.service.impl;

import com.demo.mapper.StudentMapper;
import com.demo.mapper.po.StudentPO;
import com.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * Created by Administrator on 2017/6/16 0016.
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public int deleteByPrimaryKey(String id) throws Exception {
        return studentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(StudentPO record) throws Exception {
        record.setId(UUID.randomUUID().toString());
        return studentMapper.insert(record);
    }

    @Override
    public StudentPO selectByPrimaryKey(String id) {
        return studentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int update(StudentPO record) throws Exception {
        return studentMapper.update(record);
    }
}
